# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: team/kde <bribbers@disroot.org>

# The group tag is just to easily find this APKBUILD by some scripts for automation
# group=kde-frameworks-old
pkgname=kwayland5
pkgver=5.115.0
pkgrel=0
pkgdesc="Qt-style Client and Server library wrapper for the Wayland libraries"
arch="all !armhf" # armhf blocked by extra-cmake-modules
url="https://www.kde.org"
license="LGPL-2.1-only OR LGPL-3.0-only"
depends_dev="
	qt5-qtwayland-dev
	wayland-dev
	"
makedepends="$depends_dev
	doxygen
	extra-cmake-modules
	plasma-wayland-protocols
	qt5-qtbase-dev
	qt5-qttools-dev
	wayland-protocols
	samurai
	"
_repo_url="https://invent.kde.org/frameworks/kwayland.git"
source="https://download.kde.org/stable/frameworks/${pkgver%.*}/kwayland-$pkgver.tar.xz"
subpackages="$pkgname-dev $pkgname-doc $pkgname-dbg"
options="!check" # Fails due to requiring running Wayland compositor
builddir="$srcdir/kwayland-$pkgver"

replaces="kwayland<=5.110.0-r0"

build() {
	cmake -B build -G Ninja \
		-DCMAKE_BUILD_TYPE=RelWithDebInfo \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib \
		-DBUILD_QCH=ON
	cmake --build build
}

check() {
	ctest --test-dir build --output-on-failure
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}

sha512sums="
d4279353a7179001f19bd6962595c321161ec5f5fa24518af4326b21dab56caeed5a86cc82c5335cd8288c0b348feccfb59ec8e3ee0ec0f418972c29d48832ec  kwayland-5.115.0.tar.xz
"
